<%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2018/4/17
  Time: 16:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    String username = request.getParameter("username");
    String password = request.getParameter("password");

    if ("admin".equals(username) &&
            "123456".equals(password)
            ) {
        out.write("<p>登录成功！</p>");

        //session里原本没有值，登录成功后，就有了一个变量isLogin,值为true
        session.setAttribute("isLogin", "true");
        response.sendRedirect("index.jsp");
    } else {
        out.write("<p>登录失败!</p>");
    }
%>
</body>
</html>
